<?php 

namespace App\Http\Controllers;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Bor;
use Redirect;


	class MoneyController extends Controller{

		public function money(){

			return view('Home.money');
		}

		public function tomoney(Request $req){
        if (empty($_POST)) {
			return view('Home.tomoney');
		}else{
			// dd($req->all());
        	$bos = new Bor();
        	$bos->username = $req->username;
        	$bos->money = $req->money;
        	$bos->month = $req->month;
        	$bos->phone = $req->phone;
        	if ($bos->save()) {
                 return Redirect::to('home/money'); 
        	}else{
                 return Redirect::to('home/tomoney'); 
        	}

		}
		}
	}

 ?>